<!-- 
 * @description: 
 * @fileName: swiperDetail.vue 
 * @author: 自己的名字 
 * @date: 2025-07-21 11:06:00
 * @version: V1.0.0 
!-->
<script setup lang='ts'>
import Tabbar from '@/components/Tabbar/tabbar.vue'
import threeSwiper from '@/components/Swiper/threeSwiper.vue'
import Back from '@/components/Back/Back.vue'
import { companyData, chunkArray } from './data'
import { onLoad, onShow } from '@dcloudio/uni-app'
const optionsObj = ref()
onLoad((options) => {
    if (options) {
        optionsObj.value = options
    }
})
onShow(() => {
    filterArray()
})
const filterData = ref()
const imageList = ref()
async function filterArray() {
    if (!optionsObj.value.type) {
        return new Array()
    }
    let list: any = companyData.CompanyProfile.filter(item => item.type === optionsObj.value.type)[0]
    imageList.value = list.swiperData.map((item: any) => item.image)
    filterData.value = chunkArray(list.swiperData, 3);
}

</script>
<template>
    <Tabbar />
    <view class=" absolute w-full h-[75vh] flex flex-col  items-center  mt-15">
        <Back :title="optionsObj.title" />
        <threeSwiper :filterList="filterData" :list="imageList" />
    </view>
</template>


<style scoped lang='scss'></style>